﻿using System;
using System.ComponentModel;
using System.Xml.Serialization;
using Plugin.Designer;

namespace SharpGen.Templates
{
    [Serializable]
    public class SharpGenProject : PluginProject
    {
        private StringReplacementCollection _stringReplacementList = new StringReplacementCollection();
        [XmlElement]
        public StringReplacementCollection StringReplacement
        {
            get { return _stringReplacementList; }
        }

        public SharpGenProject(string fileName)
            : base(fileName)
        {
            _stringReplacementList.PropertyChanged += new PropertyChangedEventHandler(_stringReplacement_PropertyChanged);
        }

        public SharpGenProject()
            : base()
        {
            _stringReplacementList.PropertyChanged += new PropertyChangedEventHandler(_stringReplacement_PropertyChanged);
        }

        void _stringReplacement_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            OnPropertyChanged("StringReplacement");
        }
    }
}
